package com.wyg.action;

import java.io.File;

import com.opensymphony.xwork2.ActionSupport;
import com.wyg.pojo.Test;
import com.wyg.service.UserService;
import com.wyg.service.impl.UserServiceImpl;

public class UserAction extends ActionSupport{
	
	
	private File userpic;
	private String userpicFileName;
	private String userpicContentType;
	private UserService usi;
	
	private String phone;
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}

	private Test test;
	public Test getTest() {
		return test;
	}
	public void setTest(Test test) {
		this.test = test;
	}

	private int id;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}

	public UserService getUsi() {
		return usi;
	}
	public void setUsi(UserService usi) {
		this.usi = usi;
	}

	public File getUserpic() {
		return userpic;
	}

	public void setUserpic(File userpic) {
		this.userpic = userpic;
	}

	public String getUserpicFileName() {
		return userpicFileName;
	}

	public void setUserpicFileName(String userpicFileName) {
		this.userpicFileName = userpicFileName;
	}

	public String getUserpicContentType() {
		return userpicContentType;
	}

	public void setUserpicContentType(String userpicContentType) {
		this.userpicContentType = userpicContentType;
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	//登录
	public String login(){
		System.out.println("UserAction---login");
		return "successs";
	}
	
	//精选试题
	public String showPartQuestion(){
		String result = usi.showPartQuestion();
		return result;
	}
	
	//选择题
	public String showChoiceQuestion(){
		String result = usi.showChoiceQuestion();
		return result;
	}
	
	//判断题
	public String showPanduanQuestion(){
		String result = usi.showPanduanQuestion();
		return result;
	}
	//go激活
	public String goDoActive(){
		return "doActive";
	}
	//激活
	public String doActive(){
		String result = usi.doActive(getId());
		return result;
	}
	//考试报名
	public String registTest(){
		Test test = getTest();
		String result = usi.registTest(test);
		return result;
	}
	//参加考试确认个人信息
	public String checkInfo(){
		String result = usi.checkSign(getPhone());
		return result;
	}
	//出题
	public String showTestQuestion(){
		
		String result = usi.showTestQuestion();
		return result;
	}
}
